package com.wyp168.jse.sort;

import com.sun.org.apache.xml.internal.utils.StringComparable;

import java.util.Arrays;
import com.wyp168.jse.utils.StringComparator;

/**
 * @ClassName ArrayXZort
 * @Title TODO
 * @Description TODO
 * @Author wyp168
 * @Date 2022/10/8 06:55
 */
public class ArrayXSort {
    public static void main(String[] args) {
//        Integer[] nums1 = {1,2,3,4,5,6};
//        int[] nums2 = {5,1,23,5,7,1};
//
//        Arrays.sort(nums1, (i,j) -> nums1[i] - nums1[j]);

        String[] stringArray = {"hello","abc","iii"};
        Arrays.sort(stringArray, new StringComparator());

        for (String s : stringArray) {
            System.out.println(s);
        }
    }
}
